img1 = new Image(16, 16);  
img1.src="assets/img/spinner.gif";
img2 = new Image(220, 19);  
img2.src="assets/img/ajax-loader.gif";
$(document).ready(function(){
$("#login_link").click(function(){
$('#login_form').modal();
});
$("#status > form").submit(function(){  
$('#submit').hide();
$('#ajax_loading').show();
var str = $(this).serialize();  
$.ajax({  
    type: "POST",
    url: "auth.php",
    data: str,  
    success: function(msg){  
   
$("#status").ajaxComplete(function(event, request, settings){  
$('#submit').show();
$('#ajax_loading').hide();  

 if(msg == 'OK')
 {  
 var login_response = '<div id="logged_in">' +
	 '<div style="width: 350px; float: left; margin-left: 70px;">' + 
	 '<div style="width: 40px; float: left;">' +
	 '<img style="margin: 10px 0px 10px 0px;" align="absmiddle" src="assets/img/ajax-loader.gif">' +
	 '</div>' +
	 '<div style="margin: 10px 0px 0px 10px; float: right; width: 300px;">'+ 
	 'Entrando<br /></div></div>';  

$('a.modalCloseImg').hide();  

$('#simplemodal-container').css("width","500px");
$('#simplemodal-container').css("height","120px");
 
 $(this).html(login_response); 
setTimeout('go_to_private_page()', 3000); 
 }  
 else
 {  
 var login_response = msg;
 $('#login_response').html(login_response);
 }  
      
 });  
   
 }  
   
  });  
 return false;

});
});

function go_to_private_page()
{
window.location = '../view.php';
}